//学科评估
<template>
  <div class="module_">
    <div class="mb8">
      <search @clearSearch='clearSearch'>
        <el-form label-width='60px' inline autocomplete="off" :model="pageparm" class="search_box">
          <el-form-item label="名称">
            <el-input size="medium" clearable v-model="editForm.phone" placeholder="请输入名称搜索" />
          </el-form-item>
        </el-form>
        <template slot="footer">
          <el-button size="medium" type="primary" @click="handle({arr:[]},1)">添加</el-button>
        </template>
      </search>
    </div>
    <el-table :data="tableData" class="flex-1" height="100%" size="medium" border highlight-current-row
      v-loading="tableLoading" stripe @sort-change="tableSortChange">
      <el-table-column align="center" show-overflow-tooltip prop="name" label="名称" width="250" sortable="custom">
      </el-table-column>
      <el-table-column align="center" show-overflow-tooltip prop="zj" label="专家" width="550" sortable="custom">
      </el-table-column>
      <el-table-column align="center" label="操作" width="120">
        <div class="flex-justify-end" slot-scope="scope">
          <el-tooltip effect="dark" content="修改信息" placement="bottom-end">
            <el-button size="small" @click="handle(scope.row,2)" icon="el-icon-edit" circle></el-button>
          </el-tooltip>
          <el-tooltip effect="dark" content="删除" placement="bottom-end">
            <el-button size="small" type="danger" icon="el-icon-delete" circle></el-button>
          </el-tooltip>
        </div>
      </el-table-column>
    </el-table>

    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>

    <el-dialog :visible.sync="editFormVisible" width="400px" :close-on-click-modal='false'
      :close-on-press-escape='false'>
      <el-form autocomplete="off" label-width="60px" >
        <el-form-item label="名称" class="tip">
          <el-input size="medium" clearable v-model="editForm.name" placeholder="请选择人员" />
        </el-form-item>
        <el-form-item label="专家" class="tip">
          <el-select v-model="editForm.arr" multiple placeholder="请选择">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="flex-justify-bcenter">
        <el-button @click="editFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="submit" :loading='btnLoading'>确 定</el-button>
      </div>
    </el-dialog>

    <!-- 审核 -->
    <examine ref="examine" @submit='(options)=>examineSubmit(options,1)' />
  </div>
</template>

<script>
  export default {
    data() {
      return {
        tableData: [{
          name: '委员会一',
          zj: '张三、李四',
          arr:[1,2]
        }, {
          name: '委员会二',
          zj: '张三、王五、甲',
          arr:[1,3,4]
        }],
        editFormVisible: false,
        editForm: {}, //修改或者查看详情

        pageparm: {
          page: 1,
          perPage: 20,
          total: null,
          sort_str: null,
          sort_order: 'desc',
        },
        tableLoading: false,

        btnLoading: false,

        dialogTitle: '',
        options:[
          {
            label:'张三',
            value:1
          },
          {
            label:'李四',
            value:2
          },
          {
            label:'王五',
            value:3
          },
          {
            label:'甲',
            value:4
          },
        ]

      }
    },
    mounted() {},
    methods: {
      handle(item, i) {
        this.editForm = {
          ...item
        }
        this.editFormVisible = true
      },
      examineSubmit() {

      },
      examine_btns(item, i) {
        this.$refs.examine.examineShow = true
      },
      tableSortChange(column) {
        if (column.order === "descending") {
          this.pageparm.sort_str = column.prop;
          this.pageparm.sort_order = "desc";
        } else if (column.order === "ascending") {
          this.pageparm.sort_str = column.prop;
          this.pageparm.sort_order = "asc";
        } else {
          this.pageparm.sort_str = null;
          this.pageparm.sort_order = null;
        }
        this.getList()
      },
      //搜索
      clearSearch() {
        // this.$refs.search_d.clear()
      },
      searchChane(i, val) {
        this.pageparm[val] = i
        this.pageparm.page = 1
        this.getList()
      },
      //分页
      callFather(pageparm) {
        this.pageparm.page = pageparm.page
        this.pageparm.perPage = pageparm.perPage
        this.getList()
      },
      getList() {
        this.tableLoading = true
        Apievaluatetask(this.pageparm).then(({
          data,
          page
        }) => {
          this.tableData = data || []
          this.pageparm.total = page.total
          this.tableLoading = false
        }).catch(() => {
          this.tableLoading = false
        })
      },
      submit() {

      }
    },

  }
</script>